/**********************************************************************//**
 @file draw.hpp 
 @brief Contains methods for drawing objects in the canvas
 @author Ricardo C. Marques <rmarques@inf.puc-rio.br>
 @version 0.0.1
 @date 05/11/2012
**************************************************************************/
#ifndef _DRAW_HPP
#define _DRAW_HPP

// Convert Raster and World Coordinates
void RasterToWorld( float  rasterX, float  rasterY, 
                   float*  worldX, float*  worldY  );
void WorldToRaster( float   worldX, float   worldY,
                   float* rasterX, float* rasterY   );

// Set and Get Visualization Window (in world coordinates)
void GetVisualizationWindow( float* xmin, float* xmax, 
                            float* ymin, float* ymax   );
void SetVisualizationWindow( float  xmin, float  xmax, 
                            float  ymin, float  ymax   );

// Set function responsible for drawing the model
typedef void (*DrawFunc)(void);
void SetDrawModelFunc(DrawFunc func);
//DrawModelFunc GetDrawModelFunc();
void SetDrawEventFunc(DrawFunc func);

// Auxiliary Drawing Functions
void DrawPoints( float* points, size_t num_points, 
                 float pointsize=5.f, float r=1.f, float g=0.f, float b=0.f );
void DrawWirePolygon( float* vertices, size_t num_vertices, 
                      float linewidth=2.f, float border_r=1.f, float border_g=0.f, float border_b=0.f );
void DrawSolidPolygon( float* vertices, size_t num_vertices,
                       float fill_r=1.f, float fill_g=0.f, float fill_b=0.f );
void DrawWireMesh ( float* nodes, unsigned int* triangles, size_t num_triangles, 
                    float linewidth=2.f, float edge_r=1.f, float edge_g=0.f, float edge_b=0.f  );
void DrawSolidMesh( float* nodes, unsigned int* triangles, size_t num_triangles,
                    float faces_r=0.f, float faces_g=1.f, float faces_b=0.f );

// Display Callback function
void DisplayCanvas(void);

// Set Display Options
void ChangeAxisDisplayMode(void);
void ChangeGridDisplayMode(void);

#endif